package _base0;

import java.util.HashSet;

/**
 * 2586. 统计范围内的元音字符串数
 */
public class No2586 {
    public int vowelStrings(String[] words, int left, int right) {
        int answer = 0;
        HashSet<Character> hashSet = new HashSet<>();
        hashSet.add('a');
        hashSet.add('e');
        hashSet.add('i');
        hashSet.add('o');
        hashSet.add('u');
        for (int i = left; i <= right; i++) {
            String word = words[i];
            if (hashSet.contains(word.charAt(0)) && hashSet.contains(word.charAt(word.length() - 1)))
                answer++;
        }
        return answer;
    }
}
